<?php $this->load->view('includes/header'); ?>
<div class="container">
    <div class="row">
	   <div class="col-md-9">
		  <h1>Panel de Control <small>Listado de Peliculas</small></h1>
		  <hr>
		  <?php if (isset($error) && $error): ?>
    		  <div class="alert alert-info alert-dismissable">
    			 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<?php
				if (isset($msg) && $msg != ' ') {
				    echo $msg;
				}
				?>
    		  </div>

		  <?php endif ?>
		  <table class="table table-bordered table-hover tablesorter">
                <thead>
				<tr>
				    <th>Titulo <i class="fa fa-sort"></i></th>
				    <th>Año <i class="fa fa-sort"></i></th>
				    <th>Idioma <i class="fa fa-sort"></i></th>
				    <th>Genero <i class="fa fa-sort"></i></th>
				    <th>Calificación <i class="fa fa-sort"></i></th>
				    <th>Ptos. <i class="fa fa-sort"></i></th>
				    <th>Operaciones</th>
				</tr>
                </thead>
                <tbody>
				
				<?php foreach ($peliculas as $value): ?>
                        <tr>
    				    <td><?php echo $value['titulo_dist']; ?></td>
    				    <td><?php echo $value['anyo']; ?></td>
    				    <td><?php echo $value['cod_idioma']; ?></td>
    				    <td><?php echo $value['cod_genero']; ?></td>
    				    <td><?php echo $value['cod_calificacion']; ?></td>
    				    <td><?php echo $value['puntuacion']; ?></td>
    				    <td>
    					   <a href="/peliculas/insert/<?php echo $value['cod_pelicula']; ?>/" title="Editar pelicula"><i class="fa fa-pencil"></i></a>
    					   <a href="/peliculas/eliminar/<?php echo $value['cod_pelicula']; ?>/" title="Eliminar pelicula"><i class="fa fa-trash-o"></i></a>
    				    </td>
                        </tr>
				<?php endforeach; ?>
                </tbody>
		  </table>
	   </div>
    </div>
</div>
<?php $this->load->view('includes/footer'); ?>